package com.neusoft.lohas.common.pay.payutil.unionpay.conf;

import java.io.InputStream;
import java.util.PropertyResourceBundle;

/**
 * Created with IntelliJ IDEA.
 * User: HS-AVA
 * Date: 14-1-8
 * Time: 上午9:36
 * To change this template use File | Settings | File Templates.
 */
public class SklConfig {
	// 编码方式
	public static String CHARSET;

	// 交易网址
	public static String TRADE_URL;

	// 查询网址
	public static String QUERY_URL;

	// 商户代码
	public static String MER_ID;

	// 加密方式
	public static String SIGN_TYPE;

	// 商户密匙
	public static String SECURITY_KEY;

	private static final String KEY_CHARSET = "charset";
	private static final String KEY_TRADE_URL = "skl.trade.url";
	private static final String KEY_QUERY_URL = "skl.query.url";
	private static final String KEY_MER_ID = "mer.id";
	private static final String KEY_SIGN_METHOD = "sign.method";
	private static final String KEY_SECURITY_KEY = "security.key";

	// 成功应答码
	public static final String RESPONSE_CODE_SUCCESS = "00";

	// 签名
	public final static String SIGNATURE = "mac";

	// 签名方法
	public final static String SIGN_METHOD = "signMethod";

	// 应答码
	public final static String RESPONSE_CODE = "respCode";

	// 应答信息
	public final static String RESPONSE_MSG = "respMsg";

	private static final String CONF_FILE_NAME = "skl.properties";

	static {

		try {
			InputStream fis = SklConfig.class.getClassLoader()
					.getResourceAsStream(CONF_FILE_NAME);
			PropertyResourceBundle props = new PropertyResourceBundle(fis);
			CHARSET = props.getString(KEY_CHARSET);
			TRADE_URL = props.getString(KEY_TRADE_URL);
			QUERY_URL = props.getString(KEY_QUERY_URL);
			MER_ID = props.getString(KEY_MER_ID);
			SIGN_TYPE = props.getString(KEY_SIGN_METHOD);
			SECURITY_KEY = props.getString(KEY_SECURITY_KEY);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public static void main(String[] args) {

		System.out.println("some");
	}
}
